#!/bin/bash

# author: tien
# email : sulayman_soyir@outlook.com 
# brief : soft links will expire when folder of some lib copied to target machine,
#         this scipt will re-soft-link

Dir=$1
field1=$2
field2=$3
# echo "declare -A m"
# map Usage: 1. keys: echo ${!m[@]} 2. values: echo ${m[@]} 3. mapSize: echo ${#m[@]}
# for key in ${!m[*]}
# do
#     ehco ${key}
#     echo ${m[$key]}
# done
ls -al ${Dir} | grep ">" | awk '{printf "m[\"%s\"]=\"%s\"\n",$f1,$f2}' f1=${field1} f2=${field2}
